<!DOCTYPE html>
<html>

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
    <style>
        * {
            margin: 0;
            padding: 0;
        }
        
        img {
            max-width: 100%;
            width: auto;
            height: auto;
        }
    </style>
    <title>测试</title>

    <link rel="stylesheet" type="text/css" href="css/bootstrap.min.css">

</head>

<body style="width: 100%;height: 100%;padding: 0px">

    <div id="div_box"> </div>



    <table id="t" class="table table-bordered">

    </table>


</body>


<style type="text/css">
    .btn {
        width: 50px;
        height: 40px
    }
</style>

<script type="text/javascript">
    function getRevOrdList(objs, msg) {

        window.android.callAndroid("", "loading");
        if (objs.status == "0") {
            var res = objs.data

            //var res = [{  "arcimDesc":"0.9%氯化钠注射液(塑瓶)[100ml]", "recOrdDateTime":"2021-01-06 11:34"},{  "arcimDesc":"0.9%氯化钠注射液(塑瓶)[100ml]", "recOrdDateTime":"2021-01-06 11:34"}]

            showElement("Js收到消息-->getRevOrdList , name:" + res.length + "  参数2:" + res[0].arcimDesc);

            /*
			<tr>
				<th>开始时间</th>
				<th>状态</th>
				<th>医嘱名称</th>
				<th>剂量</th>
				<th>总量</th>
			</tr>
		
			*/

            var t = document.getElementById("t");
            for (var j = 0; j < res.length; j++) {
                var tr = document.createElement('tr');

                var th = document.createElement('th');
                th.innerHTML = res[j].recOrdDateTime;
                tr.appendChild(th);

                var th2 = document.createElement('th');
                th2.innerHTML = res[j].arcimDesc;
                tr.appendChild(th2);

                t.appendChild(tr);
            }

        } else {
            window.android.callAndroid("fail:" + objs.msg, "dialog");
        }
    }
    //获取扫码
    function getScanMsg(scanInfo) {
        alert(scanInfo)
            //showElement("Js收到消息--> scanInfo:"+scanInfo);
        if (window.android != null) {
            window.android.callAndroid("show", "loading");
            var content = {
                params: {
                    regNo: "" + scanInfo
                },
                method: "getRevOrdList",
                version: "3.3"
            }
            var content = JSON.stringify(content)

            window.android.callAndroid(content, "request");

        } else {
            alert(typeof(window.android));
        }
    }
    // getRevOrdList({"status":"0"},"")

    /*
	 function callByAndroidMoreParams(objs,msg2,msg3){
	    
		alert("Js收到消息："+"id:"+objs.id.toString()+" name:"+objs.name+" age:"+objs.age.toString()+msg2+msg3);
		showElement("Js收到消息-->方法callByAndroidMoreParam被调用 , 参数1:"+objs+"  参数2:"+msg2+"  参数3:"+msg3);
		return {"name":"来自html的消息"};
	 }
   
   */

    function showElement(msg) {
        var div = document.getElementById("div_box"); //获取div
        var ele = document.createElement('h6'); //创建h2元素节点
        ele.innerHTML = msg; //设置h2节点的内容
        div.appendChild(ele); //添加子节点ele


    }
</script>








</html>